package com.dd.admin.business.detailServer.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dd.admin.business.sellDetail.entity.SellDetail;
import com.dd.admin.common.model.PageFactory;
import com.dd.admin.business.detailServer.entity.SellDetailServer;
import com.dd.admin.business.detailServer.mapper.SellDetailServerMapper;
import com.dd.admin.business.detailServer.service.SellDetailServerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.dd.admin.business.detailServer.domain.SellDetailServerVo;
import com.dd.admin.business.detailServer.domain.SellDetailServerDto;
import java.util.List;

/**
 * <p>
 * 订单详单服务人员 服务实现类
 * </p>
 *
 * @author 727869402@qq.com
 * @since 2024-11-28
 */
@Service
public class SellDetailServerServiceImpl extends ServiceImpl<SellDetailServerMapper, SellDetailServer> implements SellDetailServerService {

    @Override
    public IPage<SellDetailServerVo> selectSellDetailServerPage(SellDetailServerDto detailServerDto) {
        Page page = PageFactory.defaultPage();
        return baseMapper.selectSellDetailServerPage(page,detailServerDto);
    }

    @Override
    public List<SellDetailServerVo> selectSellDetailServerList(SellDetailServerDto detailServerDto) {
        return baseMapper.selectSellDetailServerList(detailServerDto);
    }

    @Override
    public List<SellDetailServer> selectSellDetailServerListBySellDetailIds(List<String> sellDetailIds) {
        LambdaQueryWrapper<SellDetailServer> selldetailQueryWrapper = new LambdaQueryWrapper<>();
        if(CollectionUtil.isNotEmpty(sellDetailIds)){
            selldetailQueryWrapper.in(SellDetailServer::getSellDetailId, sellDetailIds);
        }
        List<SellDetailServer> sellDetailList = this.list(selldetailQueryWrapper);
        return sellDetailList;
    }
}
